package OtherSwing;

public class sortBubble {
	public static int[] SortBubble(String bubble1){
		String delimeter =" ";
		String[] parts = bubble1.split(delimeter);
		int[] array =  new int[parts.length];
		for(int i=0; i<parts.length; i++){
			array[i] = Integer.parseInt(parts[i]);
		}
	      
	       int n = array.length;
	    	int swap;
	    	    for (int c = 0; c < ( n - 1 ); c++) {
	    	      for (int d = 0; d < n - c - 1; d++) {
	    	        if (array[d] > array[d+1]) /* For descending order use < */
	    	        {
	    	          swap       = array[d];
	    	          array[d]   = array[d+1];
	    	          array[d+1] = swap;
	    	        }
	    	      }
	    	    }
				return array;
	    	 
			
}
}
